local yushi = fk.CreateSkill{
    name = "ym_water__yushi",
}
Fk:loadTranslationTable{
    ["ym_water__yushi"] = "喻诗",
    [":ym_water__yushi"] = "连招技（牌+牌···），若连招牌名字数和恰为七，你可以视为使用一张无次数限制的【酒】，若超出则你将手牌数调整至超出数且此技能本回合失效。",
    ["#ym_water__yushi-analeptic"] = "喻诗：你可以视为使用一张无次数限制的【酒】",
    ["@ym_water__yushi"] = "喻诗",

    ["$ym_water__yushi1"] = "我吟杜诗清入骨，灌顶何必须醍醐？",
    ["$ym_water__yushi2"] = "烟分顶上三层绿，剑截眸中一寸光。",
    ["$steam__jiangu_ym_water__cuijue1"] = "崔氏之骨名，甚衰之可哀。",
    ["$steam__jiangu_ym_water__cuijue2"] = "梦回清河，回神纸尽墨。",
}
yushi:addEffect(fk.CardUsing,{
    anim_type = "drawcard",
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(yushi.name) and
        data.extra_data and data.extra_data.combo_skill and data.extra_data.combo_skill[yushi.name]
    end,
    on_cost = function (self, event, target, player, data)
        local room = player.room
        local cost_data = {number = player:getMark("@ym_water__yushi")}
        room:setPlayerMark(player,"@ym_water__yushi",0)
        if cost_data.number == 7 then
            local use = room:askToUseVirtualCard(player, {
                name = "analeptic",
                skill_name = yushi.name,
                prompt = "#ym_water__yushi-analeptic",
                extra_data = {
                    bypass_times = true,
                    extraUse = true,
                },
                skip = true,
            })
            if use then
                cost_data.use = use
                p(cost_data)
                event:setCostData(self,cost_data)
                return true
            end
        else
            event:setCostData(self,cost_data)
            return true
        end
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        if event:getCostData(self).number == 7 then
            local use = event:getCostData(self).use
            p(use)
            room:useCard(use)
        else
            local n = event:getCostData(self).number-7-player:getHandcardNum()
            if n > 0 then
                player:drawCards(n,yushi.name)
            elseif n < 0 then
                room:askToDiscard(player,{
                    max_num = -n,
                    min_num = -n,
                    skill_name = yushi.name,
                    include_equip = false,
                    cancelable = false,
                })
            end
            room:invalidateSkill(player, yushi.name, "-turn")
        end
    end,
})
yushi:addEffect(fk.AfterCardUseDeclared, {
    can_refresh = function (self, event, target, player, data)
        return target == player and player:hasSkill(yushi.name)
    end,
    on_refresh = function (self, event, target, player, data)
        local room = player.room
        local lens = Fk:translate(data.card.trueName, "zh_CN"):len()
        room:addPlayerMark(player, "@ym_water__yushi", lens)
        if player:getMark("@ym_water__yushi") >= 7 then
            data.extra_data = data.extra_data or {}
            data.extra_data.combo_skill = data.extra_data.combo_skill or {}
            data.extra_data.combo_skill[yushi.name] = true
        end
    end,
})
return yushi